
const THREE_HOURS_IN_SECONDS: u32 = 60 * 60 * 3;

fn main() {
    // mut表示变量x可以被修改，否则编译报错不可变的值不能被修改
    let mut x = 5; 
    println!("The value of x is: {}", x);
    x = 6;
    println!("The value of x is: {}", x);

    // 常量
    println!("The value of THREE_HOURS_IN_SECONDS is: {}", THREE_HOURS_IN_SECONDS);

    // 隐藏
    let y = 5;
    let y = y + 1;
    {
        let y = y + 2;
        println!("The value of y in inner scope is: {}", y);
    }
    println!("the value of y is: {}", y);

    let abc = 100_f64 * 3.14;
    println!("{}", abc);

    let tup_a = (1, 3.14, 'A');
    let (a, b, c) = tup_a;
    println!("The value of tup_a is: {:?} {a},{b},{c}", tup_a);

    let mut a = [1, 2, 3];
    println!("The value of a is: {:?}, len:{}", a, a.len());
    a[0] = 100;
    println!("The value2 of a is: {:?}, len:{}", a, a.len());
}
